import axios from 'axios';

//用户登录接口
const login=function(username,password){
  return axios.post('http://localhost:5000/login',{username,password})
}

const register=function(username,password,email,sex,description){
  return axios.post('http://localhost:5000/register',{username,password,email,sex,description})
}

const getArticle=function(page,size,category){
  return axios.post('http://localhost:5000/getArticle',{page,size})
}

const alterAinfo=function(aid,type,num){
  return axios.post('http://localhost:5000/alterAinfo',{aid,type,num})
}

const getContent=function(aid){
  return axios.post('http://localhost:5000/getContent',{aid})
}

const search=function(text){
  return axios.post('http://localhost:5000/search',{text})
}

export{
  login,
  register,
  getArticle,
  alterAinfo,
  getContent,
  search
}